<?php
namespace AuctionCore\CarResource;


/**
* 车型类功能 测试类
* @author       Eric Lee
*/
class CarModelTest extends \PHPUnit_Framework_TestCase {
    
    public function test_get_parent_brand_info(){
        //获得车型的父品牌信息
        $cm = new \AuctionCore\CarResource\CarModel();
        $info = $cm->get_parent_brand_info(15);
        $this->assertTrue(count($info)>3);
    }


    public function test_sample(){        
        $cm = new \AuctionCore\CarResource\CarModel();
        $info = $cm->get_parent_brand_info(15);
        $series_id = $info['series']['series_id'];
        $brand_id = $info['brand']['brand_id'];
        $mbrand_id = $info['mbrand']['mbrand_id'];

        //获得指定主品牌的子品牌信息
        $brands = $cm->get_brand_by_mbrand($mbrand_id);
        $this->assertTrue(count($brands)>0);

        //获得所有子品牌信息
        $brands = $cm->get_brand_by_mbrand();        
        $this->assertTrue(count($brands)>0);

        //获得品牌车系信息
        $series = $cm->get_series_by_brand($brand_id);
        $this->assertTrue(count($series)>0);

        //获得车系车型信息
        $models = $cm->get_model_by_series($series_id);
        $this->assertTrue(count($models)>0);

       /* dump($brands);
        dump($series);
        dump($models);*/
    }
}

?>